<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/media/js/jquery.dataTables.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/extras/TableTools/media/js/ZeroClipboard.js" type="text/javascript"></script>
<script src="<?php echo base_url() ?>commons/tablas/extras/TableTools/media/js/TableTools.js" type="text/javascript"></script>

<style type="text/css" title="currentStyle">
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_page.css";
			@import "<?php echo base_url() ?>commons/tablas/media/css/demo_table.css";
                        @import "<?php echo base_url() ?>commons/tablas/extras/TableTools/media/css/TableTools.css";
		</style>
<script type="text/javascript">
    var t=jQuery.noConflict();
			t(document).ready(function() {
				t('#example').dataTable( {
					"sPaginationType": "full_numbers",
                  "sDom": 'T C lfrtip', 
                    "oTableTools": { 
                    "sSwfPath": "<?php echo base_url() ?>commons/tablas/extras/TableTools/media/swf/copy_csv_xls_pdf.swf", 
                    "aButtons": [ 
                    "xls",], 
                    },
               } );
	} );
</script>

<div id="buscar1"  align="center">

    <form class="well form-search" action="<?php echo base_url() . "admin.php/coutas/presearch/".$ide_per ?>" method="post" >
        <div class="control-group">
            <label class="control-label" for="select01">PERIODO ACTUAL</label>
            <div class="controls ">
                <select name="ide_per" class="span3" autofocus
                        ONCHANGE="javascript:enviar(this.options[this.selectedIndex].value, '<?php echo (base_url()) . "admin.php/asignar_rubro_controlador/listado" ?>');">
                            <?php
                            if ($ide_per == -1)
                                echo ("<option value='-1' selected>Seleccionar Periodo</option>");
                            foreach ($periodos as $i => $per) {
                                echo ("<option value='" . $per["ide_lec"] ."'".($per['ide_lec'] == $ide_per ? " selected" : " ").">");
                                echo ($per["descripcion_lec"] . "</option>");
                            }
                            ?>
                </select>
                

            </div>
            
                
        </div>
      <div class="control-group">
            <label class="control-label" for="select02">RUBROS</label>
            <div class="controls ">
                <select name="ide_rubro" class="span3" autofocus
                            ONCHANGE="javascript:enviar1('<?php echo (base_url()) . "admin.php/asignar_rubro_controlador/listado" ?>',
                                            '<?php echo $ide_per ?>', this.options[this.selectedIndex].value);">
                        <?php
                        if ($ide_rubro == -1)
                                echo ("<option value='-1' selected>Seleccionar Periodo</option>");
                        foreach ($rubros as $i => $rub) {

                            echo ("<option value='" . $rub["ide_rubro"] . "'");
                            echo (($ide_rubro == $rub["ide_rubro"] ? " selected" : "") . ">");
                            echo ($rub["nombre_rubro"] . "</option>");
                        }
                        ?>

                    </select>
                </select>

            </div>
            
                
        </div>        
        



    </form> 

</div>

<?php if (!empty($inscritos)) { ?>
<h3>LISTADO DE ESTUDIANTES QUE ADEUDAN RUBROS</h3>
    <div id="tabla" >
        
        <table id="example" class="table table-bordered table-striped table-condensed">
            <thead>
                <tr>
                    <th>CEDULA</th>
                    <th>APELLIDOS</th>
                    <th>NOMBRES</th>
                    <th>VALOR</th>
                    <th>COUT</th>
                    <th>DEBE</th>
                    <th>CANC</th>
                    <th>PAGA</th>
                </tr>
            </thead>
            <tbody>
                <?php
                foreach ($inscritos as $i => $row) {
                    ?>
                    <tr>

                        <td><?php echo $row['cedula_pers'] ?></td>
                        <td><?php echo $row['apellido_pers'] ?></td>
                        <td><?php echo $row['nombre_pers'] ?></td>
                        <td><?php echo $row['costo_rubro'] ?></td>
                        <td><?php echo ($this->rubrocons_modelo->Nro_cuotas($row["id_matr"])) ?></td>
                        <td><?php echo ($this->rubrocons_modelo->Nro_Nocanceladas($row["id_matr"])) ?></td>
                        <td><?php echo ($row['estado_asigna']==1?"NO":"SI") ?></td>
                        
                        
                        <td>
                            <?php
                                  echo "<a href='".base_url(). "admin.php/coutas/procesar/" . $row['id_matr'].
                                      "'><i class='icon-edit'></i>PAGAR</a>";
                                  ?>
                        </td>


                    </tr>
                    <?php
                }
                ?>
            </tbody>
        </table>        
    </div>        




<?php }else { echo ("No existen Datos");} ?>



